home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / bbs / Hydra11s.lha / HBBS / Source / Doors_System / XPR / xproto.h < prev    next >
C/C++ Source or Header  |  1996-06-25  |  8KB  |  182 lines

  1. /** xproto.h
  2. *
  3. *   Include file for External Protocol Handling
  4. *
  5. **/
  6. /*
  7. *   The structure
  8. */
  9. struct XPR_IO {
  10.                 STRPTR   xpr_filename;
  11.                   LONG (* __asm xpr_fopen)(register __a0 STRPTR,register __a1 STRPTR);
  12.                   LONG (* __asm xpr_fclose)(register __a0 struct FileBuffer *);
  13.                   LONG (* __asm xpr_fread)(register __a0 APTR,register __d0 LONG,register __d1 LONG,register __a1 struct FileBuffer *);
  14.                   LONG (* __asm xpr_fwrite)(register __a0 APTR,register __d0 LONG,register __d1 LONG,register __a1 struct FileBuffer *);
  15.                  ULONG (* __asm xpr_sread)(register __a0 APTR,register __d0 LONG,register __d1 ULONG);
  16.                   LONG (* __asm xpr_swrite)(register __a0 APTR,register __d0 LONG);
  17.                   LONG (* __asm xpr_sflush)(VOID);
  18.                   LONG (* __asm xpr_update)(register __a0 struct XPR_UPDATE *);
  19.                   LONG (* __asm xpr_chkabort)(VOID);
  20.                   LONG (* __asm xpr_chkmisc)(VOID);
  21.                   LONG (* __asm xpr_gets)(register __a0 STRPTR,register __a1 STRPTR);
  22.                   LONG (* __asm xpr_setserial)(register __d0 LONG);
  23.                   LONG (* __asm xpr_ffirst)(register __a0 STRPTR,register __a1 STRPTR);
  24.                   LONG (* __asm xpr_fnext)(register __d0 LONG,register __a0 STRPTR,register __a1 STRPTR);
  25.                   LONG (* __asm xpr_finfo)(register __a0 STRPTR,register __d0 LONG);
  26.                   LONG (* __asm xpr_fseek)(register __a0 struct FileBuffer *,register __d0 LONG,register __d1 LONG);
  27.                   LONG   xpr_extension;
  28.                   LONG  *xpr_data;
  29.                  ULONG (* __asm xpr_options)(register __d0 LONG,register __a0 struct xpr_option **);
  30.                   LONG (* __asm xpr_unlink)(register __a0 STRPTR);
  31.                   LONG (* __asm xpr_squery)(VOID);
  32.                   LONG (* __asm xpr_getptr)(register __d0 LONG);
  33.               };
  34.  
  35. //#if 0
  36. //
  37. //struct XPR_IO {
  38. //                STRPTR   xpr_filename;      /* File name(s)             */
  39. //                  LONG (*xpr_fopen)();      /* Open file                */
  40. //                  LONG (*xpr_fclose)();     /* Close file               */
  41. //                  LONG (*xpr_fread)();      /* Get UBYTE from file       */
  42. //                  LONG (*xpr_fwrite)();     /* Put string to file       */
  43. //                 ULONG (*xpr_sread)();      /* Get UBYTE from serial     */
  44. //                  LONG (*xpr_swrite)();     /* Put string to serial     */
  45. //                  LONG (*xpr_sflush)();     /* Flush serial input buffer*/
  46. //                  LONG (*xpr_update)();     /* Print stuff              */
  47. //                  LONG (*xpr_chkabort)();   /* Check for abort          */
  48. //                  LONG (*xpr_chkmisc)();    /* Check misc. stuff        */
  49. //                  LONG (*xpr_gets)();       /* Get string interactively */
  50. //                  LONG (*xpr_setserial)();  /* Set and Get serial info  */
  51. //                  LONG (*xpr_ffirst)();     /* Find first file name     */
  52. //                  LONG (*xpr_fnext)();      /* Find next file name      */
  53. //                  LONG (*xpr_finfo)();      /* Return file info         */
  54. //                  LONG (*xpr_fseek)();      /* Seek in a file           */
  55. //                  LONG   xpr_extension;     /* Number of extensions     */
  56. //                  LONG  *xpr_data;          /* Initialized by Setup.    */
  57. //                 ULONG (*xpr_options)();    /* Multiple XPR options.    */
  58. //                  LONG (*xpr_unlink)();     /* Delete a file.           */
  59. //                  LONG (*xpr_squery)();     /* Query serial device      */
  60. //                  LONG (*xpr_getptr)();     /* Get various host ptrs    */
  61. //              };
  62. //
  63. //#endif
  64.  
  65. /*
  66. *   Number of defined extensions
  67. */
  68. #define XPR_EXTENSION 4L
  69.  
  70. /*
  71. *   The functions
  72. */
  73.  
  74. LONG XProtocolCleanup(struct XPR_IO *);
  75. LONG XProtocolSetup(struct XPR_IO *);
  76. LONG XProtocolSend(struct XPR_IO *);
  77. LONG XProtocolReceive(struct XPR_IO *);
  78. LONG XProtocolHostMon(struct XPR_IO *,APTR,LONG,LONG);
  79. LONG XProtocolUserMon(struct XPR_IO *,APTR,LONG,LONG);
  80.  
  81. #ifdef LATTICE
  82.  
  83. /* Pragmas for SAS/Lattice-C V5.0 */
  84.  
  85. #pragma libcall XProtocolBase XProtocolCleanup 1e 801
  86. #pragma libcall XProtocolBase XProtocolSetup 24 801
  87. #pragma libcall XProtocolBase XProtocolSend 2a 801
  88. #pragma libcall XProtocolBase XProtocolReceive 30 801
  89. #pragma libcall XProtocolBase XProtocolHostMon 36 109804
  90. #pragma libcall XProtocolBase XProtocolUserMon 3c 109804
  91.  
  92. #endif  /* LATTICE */
  93.  
  94. #ifdef AZTEC_C
  95.  
  96. /* Pragmas for Manx Aztec-C V5.0 */
  97.  
  98. #pragma amicall(XProtocolBase, 0x1e, XProtocolCleanup(a0))
  99. #pragma amicall(XProtocolBase, 0x24, XProtocolSetup(a0))
  100. #pragma amicall(XProtocolBase, 0x2a, XProtocolSend(a0))
  101. #pragma amicall(XProtocolBase, 0x30, XProtocolReceive(a0))
  102. #pragma amicall(XProtocolBase, 0x36, XProtocolHostMon(a0,a1,d0,d1))
  103. #pragma amicall(XProtocolBase, 0x3c, XProtocolUserMon(a0,a1,d0,d1))
  104.  
  105. #endif  /* AZTEC */
  106.  
  107. /*
  108. *   Flags returned by XProtocolSetup()
  109. */
  110. #define XPRS_FAILURE    0x00000000L
  111. #define XPRS_SUCCESS    0x00000001L
  112. #define XPRS_NORECREQ   0x00000002L
  113. #define XPRS_NOSNDREQ   0x00000004L
  114. #define XPRS_HOSTMON    0x00000008L
  115. #define XPRS_USERMON    0x00000010L
  116. #define XPRS_HOSTNOWAIT 0x00000020L
  117. /*
  118. *   The update structure
  119. */
  120. struct XPR_UPDATE {     ULONG  xpru_updatemask;
  121.                         STRPTR xpru_protocol;
  122.                         STRPTR xpru_filename;
  123.                         LONG   xpru_filesize;
  124.                         STRPTR xpru_msg;
  125.                         STRPTR xpru_errormsg;
  126.                         LONG   xpru_blocks;
  127.                         LONG   xpru_blocksize;
  128.                         LONG   xpru_bytes;
  129.                         LONG   xpru_errors;
  130.                         LONG   xpru_timeouts;
  131.                         LONG   xpru_packettype;
  132.                         LONG   xpru_packetdelay;
  133.                         LONG   xpru_chardelay;
  134.                         STRPTR xpru_blockcheck;
  135.                         STRPTR xpru_expecttime;
  136.                         STRPTR xpru_elapsedtime;
  137.                         LONG   xpru_datarate;
  138.                         LONG   xpru_reserved1;
  139.                         LONG   xpru_reserved2;
  140.                         LONG   xpru_reserved3;
  141.                         LONG   xpru_reserved4;
  142.                         LONG   xpru_reserved5;
  143.                    };
  144. /*
  145. *   The possible bit values for the xpru_updatemask are:
  146. */
  147. #define XPRU_PROTOCOL           0x00000001L
  148. #define XPRU_FILENAME           0x00000002L
  149. #define XPRU_FILESIZE           0x00000004L
  150. #define XPRU_MSG                0x00000008L
  151. #define XPRU_ERRORMSG           0x00000010L
  152. #define XPRU_BLOCKS             0x00000020L
  153. #define XPRU_BLOCKSIZE          0x00000040L
  154. #define XPRU_BYTES              0x00000080L
  155. #define XPRU_ERRORS             0x00000100L
  156. #define XPRU_TIMEOUTS           0x00000200L
  157. #define XPRU_PACKETTYPE         0x00000400L
  158. #define XPRU_PACKETDELAY        0x00000800L
  159. #define XPRU_CHARDELAY          0x00001000L
  160. #define XPRU_BLOCKCHECK         0x00002000L
  161. #define XPRU_EXPECTTIME         0x00004000L
  162. #define XPRU_ELAPSEDTIME        0x00008000L
  163. #define XPRU_DATARATE           0x00010000L
  164. /*
  165. *   The xpro_option structure
  166. */
  167. struct xpr_option {
  168.    STRPTR xpro_description;      /* description of the option                  */
  169.    LONG   xpro_type;             /* type of option                             */
  170.    STRPTR xpro_value;            /* pointer to a buffer with the current value */
  171.    LONG   xpro_length;           /* buffer size                                */
  172. };
  173. /*
  174. *   Valid values for xpro_type are:
  175. */
  176. #define XPRO_BOOLEAN 1L         /* xpro_value is "yes", "no", "on" or "off"   */
  177. #define XPRO_LONG    2L         /* xpro_value is string representing a number */
  178. #define XPRO_STRING  3L         /* xpro_value is a string                     */
  179. #define XPRO_HEADER  4L         /* xpro_value is ignored                      */
  180. #define XPRO_COMMAND 5L         /* xpro_value is ignored                      */
  181. #define XPRO_COMMPAR 6L         /* xpro_value contains command parameters     */
  182.